home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 11: TSX-11 / Linux Cubed Series 11 - TSX-11 Vol 1.iso / sbin / bootutil.1 / bootutil / bootutils / mount / Makefile < prev    next >
Encoding:
Makefile  |  1993-07-01  |  2.1 KB  |  85 lines

  1. # To make "ext" the default file system type for mount
  2. #  (used when no other type is specified), replace \"minix\" by \"ext\".
  3. DEFAULT_FSTYPE=\"minix\"
  4.  
  5. # you need rpcgen and libc-4.2 or rpclib to compile in the NFS support
  6. #DEFINES = -DHAVE_NFS
  7. #DEBUG = -g
  8. DEBUG = -O2 -fomit-frame-pointer 
  9.  
  10. # For debugging, uncomment -g in DEBUG and comment out -N in LDFLAGS.
  11. # If you prefer static binaries, add -static to the LDFLAGS.
  12.  
  13. # debug link options
  14. #LDFLAGS = $(DEBUG)
  15.  
  16. # static link options
  17. #LDFLAGS = -N -s -static
  18.  
  19. # my favorite link options
  20. LDFLAGS = -N -s
  21.  
  22. CC = gcc -Wall -Wstrict-prototypes -Wmissing-prototypes
  23. CFLAGS = $(DEBUG) -DFSTYPE_DEFAULT=$(DEFAULT_FSTYPE) $(DEFINES)
  24.  
  25. PROGS = mount umount swapon
  26. MAN5 = fstab.5 nfs.5
  27. MAN8 = mount.8 swapon.8
  28.  
  29. ifneq (,$(findstring HAVE_NFS,$(DEFINES)))
  30. NFS_OBJS = nfsmount.o mount_xdr.o mount_clnt.o
  31. # uncomment this if you don't have libc-4.2 but do have the rpclib
  32. LDLIBS = # -lrpclib
  33. RPCSVCDIR = /usr/include/rpcsvc
  34. GEN_FILES = mount.x mount.h mount_xdr.c mount_clnt.c
  35. # the old rpcgen used to generate K&R style code
  36. #RPCFLAGS = -Wno-strict-prototypes -Wno-missing-prototypes
  37. # the new rpcgen generates lots of unused variables
  38. RPCFLAGS = -Wno-unused 
  39. RPCGEN = rpcgen
  40. endif
  41.  
  42. all: $(PROGS)
  43.  
  44. install: $(PROGS)
  45.     install -s $(PROGS) /etc
  46.     install -d /usr/man/cat5
  47.     install -d /usr/man/cat8
  48.     install $(MAN5) /usr/man/cat5
  49.     install $(MAN8) /usr/man/cat8
  50.     (cd /usr/man/cat8 ; ln -sf mount.8 umount.8)
  51.     ln -sf /etc/swapon /etc/swapoff
  52.     (cd /usr/man/cat8 ; ln -sf swapon.8 swapoff.8)
  53.  
  54. mount: mount.o sundries.o fstab.o $(NFS_OBJS)
  55.  
  56. umount: umount.o sundries.o fstab.o
  57.  
  58. swapon:    swapon.o fstab.o
  59.  
  60. nfsmount.o mount_xdr.o mount_clnt.o: mount.h
  61.  
  62. nfsmount.o: nfsmount.c
  63.     $(CC) -c $(CFLAGS) $(RPCFLAGS) nfsmount.c
  64.  
  65. mount_clnt.o: mount_clnt.c
  66.     $(CC) -c $(CFLAGS) $(RPCFLAGS) mount_clnt.c
  67.  
  68. mount_xdr.o: mount_xdr.c
  69.     $(CC) -c $(CFLAGS) $(RPCFLAGS) mount_xdr.c
  70.  
  71. mount.h mount_xdr.c mount_clnt.c: mount.x
  72.     rm -f mount.h mount_xdr.c mount_clnt.c
  73.     $(RPCGEN) -h -o mount.h mount.x
  74.     $(RPCGEN) -c -o mount_xdr.c mount.x
  75.     $(RPCGEN) -l -o mount_clnt.c mount.x
  76.  
  77. mount.x:
  78.     cp $(RPCSVCDIR)/mount.x .
  79.  
  80. clean:
  81.     rm -f a.out core *~ *.o $(GEN_FILES)
  82.  
  83. clobber: clean
  84.     rm -f $(PROGS)
  85.